<!-- 小程序列表 -->
<template>
	<div class="app-container">
		<div class="wx-user-box">
			<div class="app-title">微信小程序ext</div>
			<el-form :model="formInline">
				<el-form-item label=""><el-input v-model="formInline.ext" :rows="30" type="textarea" clearable placeholder="请输入内容"></el-input></el-form-item>
				<el-form-item><el-button type="primary" @click="extUpdate()">保存</el-button></el-form-item>
			</el-form>
		</div>
	</div>
</template>

<script>
import Api from '@/api/pages/xcx/index.js';
export default {
	name: 'xcx_ext',
	data() {
		return {
			formInline: {
				ext: ''
			}
		};
	},
	mounted() {
		this.extJson();
	},
	methods: {
		extJson() {
			Api.ext_json().then(res => {
				if (res.state) {
					this.formInline.ext = res.data;
				} else {
					this.$message(res.msg);
				}
			});
		},

		extUpdate() {
			if(!this.formInline.ext) {
				this.$message('请输入内容！');
				return
			}
			Api.ext_update({
				ext:this.formInline.ext
			}).then(res => {
				if (res.state) {
					this.$message({
						message: res.msg,
						type: 'success'
					});
					this.extJson();
				} else {
					this.$message(res.msg);
				}
			});
		}
	}
};
</script>
<style lang="scss" scoped></style>

<style lang="scss">
.dialogVideo {
	.el-dialog__body {
		padding: 20px;
	}
}
</style>
